Skip to content

[DP-413] YouTube 콘텐츠 저장 스키마 마이그레이션#137

Merged
github-actions[bot] merged 1 commit intodevelopV2from
auto/feature/DP-413-youtube-schema
Apr 24, 2026
Merged

[DP-413] YouTube 콘텐츠 저장 스키마 마이그레이션#137
github-actions[bot] merged 1 commit intodevelopV2from
auto/feature/DP-413-youtube-schema

Conversation

@nYeonG4001
Copy link
Copy Markdown
Collaborator

Summary

  • contents 테이블에 extra JSONB 컬럼 추가 — YouTube 전용 필드(videoId, channelName, duration, viewCount) 저장용
  • content_sources에 YouTube 소스 등록 (data.sql) — AI 레포가 YouTube Data API 수집 후 POST /internal/contents로 전달
  • 기존 콘텐츠의 extra는 null — 기존 조회 API에 영향 없음
  • extra 파싱 → 응답 DTO 포함은 DP-414에서 처리

DB 변경

-- contents 테이블 extra 컬럼 추가 (ddl-auto:update 자동 반영)
ALTER TABLE contents ADD COLUMN extra JSONB;

-- YouTube 소스 등록
INSERT INTO content_sources (id, name, url, collect_method, is_active, created_at)
SELECT gen_random_uuid(), 'YouTube', 'https://www.youtube.com', 'api', true, NOW()
WHERE NOT EXISTS (SELECT 1 FROM content_sources WHERE name = 'YouTube');

extra JSONB 저장 구조

{
  "videoId": "dQw4w9WgXcQ",
  "channelName": "우아한Tech",
  "duration": 312,
  "viewCount": 15000
}

Test plan

  • extra=null인 기존 콘텐츠 빌더 정상 동작 확인
  • extra에 YouTube JSON 문자열 저장/조회 확인
  • 기존 피드/상세 API extra=null 시 정상 응답 확인
  • 빌드 + 전체 테스트 통과 확인

@github-actions github-actions Bot merged commit a1921f8 into developV2 Apr 24, 2026
2 checks passed
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant